package com.zb.kl.common;

/**
 * 常量类
 */
public class Const {

    //接口调用方式
    public static final String REQUEST_TYPE_POST = "POST";
    public static final String REQUEST_TYPE_GET = "GET";

    /**
     * 网关负载均衡策略
     */
    //孪生体服务轮询调用策略，分区线程，现已废弃，不区分数字线程了
    //public static final String TWIN_SERVICE_ROUND_ROBIN = "twinServiceRoundRobin";
    //通过twinCode调用孪生体服务轮询策略
    public static final String TWIN_SERVICE_BY_TWIN_CODE_ROUND_ROBIN = "twinServiceByTwinCodeRoundRobin";
    //数据源服务轮询调用策略
    public static final String DATASOURCE_SERVICE_ROUND_ROBIN = "datasourceServiceRoundRobin";
    //资源服务轮询调用策略
    public static final String RESOURCES_SERVICE_ROUND_ROBIN = "resourcesServiceRoundRobin";
    //engine服务方法轮询调用策略
    public static final String ENGINE_METHOD_ROUND_ROBIN = "engineMethodRoundRobin";

    /**
     *  数字线程中执行孪生体
     *  key=gateway:twinIp:【能力中心id】_【线程code】
     *  gateway:twinIp:12771259453344_1549904591648
     * 	hashKey=twinId   value=IP
     */
    public static final String GATEWAY_TWINIP = "gateway:twinIp:";

    /**
     * 直接调用孪生体
     * key=gateway:twinService:【能力中心id】_【twinCode】
     * hashKey=IP   value=【线程code】
     */
    public static final String GATEWAY_TWINSERVICE = "gateway:twinService:";

    /**
     * 记录孪生体所在节点IP
     */
    public static final String DIGITAL_TWIN = "DIGITAL:TWIN:";

    /**
     * 记录数据源连接信息
     * {
     *    "39": "{\"connectionParams\": \"{\\\"user\\\":\\\"root\\\",\\\"password\\\":\\\"Jd2019\\\",\\\"address\\\":\\\"jdbc:mysql://192.168.5.163:3306\\\",\\\"database\\\":\\\"kl_dt_builder\\\",\\\"jdbcUrl\\\":\\\"jdbc:mysql://192.168.5.163:3306/kl_dt_builder\\\",\\\"driverClassName\\\":\\\"com.mysql.cj.jdbc.Driver\\\",\\\"validationQuery\\\":\\\"select 1\\\"}\",         \"dbType\": \"MYSQL\",         \"id\": \"39\"       }"
     * }
     */
    public static final String DIGITAL_SYSTEM = "DIGITAL:SYSTEM:";

    /**
     * 记录数据源所在节点IP
     */
    public static final String DATASOURCE = "DATASOURCE:";

    public static final String DOLPHIN_TOKEN = "token";

    public static final String TRACE_ID = "X-Trace-Id";
    public static final String ABILITY_CODE = "X-Ability-Code";
    public static final String TWIN_CODE = "X-Twin-Code";
    public static final String ENTITY_CODE = "X-Entity-Code";
    public static final String SERVICE_CODE = "X-Service-Code";
}
